From: Swagtoy Date: Mon, 1 Jun 2026 19:24:01 +0000 (-0400) Subject: shell/app: Cleanup journalfd with g_autofd instead of close() X-Git-Tag: archive/raspbian/50.5-1+rpi1^2~14^2^2~12 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=765aebe9238dcd646a6c6f3f5a23d1af6f87324c;p=gnome-shell.git shell/app: Cleanup journalfd with g_autofd instead of close() Signed-off-by: Swagtoy Part-of: (cherry picked from commit e57c64620ea7d1b6f208a3ba53b0fcaebf764876) --- diff --git a/src/shell-app.c b/src/shell-app.c index acb996c0b..d47c49c20 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -1399,7 +1400,7 @@ shell_app_launch (ShellApp *app, /* Optimized spawn path, avoiding a child_setup function */ { - int journalfd = -1; + g_autofd int journalfd = -1; #ifdef HAVE_SYSTEMD journalfd = sd_journal_stream_fd (shell_app_get_id (app), LOG_INFO, FALSE); @@ -1414,9 +1415,6 @@ shell_app_launch (ShellApp *app, journalfd, journalfd, error); - - if (journalfd >= 0) - (void) close (journalfd); } g_object_unref (context);